package com.jincp.filepicker.bean;

import android.os.Parcel;
import android.os.Parcelable;
/**
 * =========================================================
 * @ProjectName:
 * @ClassName: AudioFile
 * @Description:
 * @Author: jincp
 * @CreateDate: 2019/3/22 21:25
 * =========================================================
 */
public class AudioFile extends BaseFile implements Parcelable {
    private long duration;

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(getId());
        dest.writeString(getName());
        dest.writeString(getPath());
        dest.writeLong(getSize());
        dest.writeString(getDirectoryId());
        dest.writeString(getDirectoryName());
        dest.writeLong(getDate());
        dest.writeLong(getDuration());
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<AudioFile> CREATOR = new Creator<AudioFile>() {
        @Override
        public AudioFile[] newArray(int size) {
            return new AudioFile[size];
        }

        @Override
        public AudioFile createFromParcel(Parcel in) {
            AudioFile file = new AudioFile();
            file.setId(in.readLong());
            file.setName(in.readString());
            file.setPath(in.readString());
            file.setSize(in.readLong());
            file.setDirectoryId(in.readString());
            file.setDirectoryName(in.readString());
            file.setDate(in.readLong());
            file.setDuration(in.readLong());
            return file;
        }
    };
}
